Integrand size = 41, antiderivative size = 108 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {(3 A-2 B+2 C) x}{2 a}-\frac {(2 A-2 B+C) \sin (c+d x)}{a d}+\frac {(3 A-2 B+2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(A-B+C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {4169, 3872, 2715, 8, 2717} \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {(2 A-2 B+C) \sin (c+d x)}{a d}+\frac {(3 A-2 B+2 C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac {(A-B+C) \sin (c+d x) \cos (c+d x)}{d (a \sec (c+d x)+a)}+\frac {x (3 A-2 B+2 C)}{2 a} \]
[In]
[Out]
Rule 8
Rule 2715
Rule 2717
Rule 3872
Rule 4169
Rubi steps \begin{align*} \text {integral}& = -\frac {(A-B+C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {\int \cos ^2(c+d x) (a (3 A-2 B+2 C)-a (2 A-2 B+C) \sec (c+d x)) \, dx}{a^2} \\ & = -\frac {(A-B+C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {(2 A-2 B+C) \int \cos (c+d x) \, dx}{a}+\frac {(3 A-2 B+2 C) \int \cos ^2(c+d x) \, dx}{a} \\ & = -\frac {(2 A-2 B+C) \sin (c+d x)}{a d}+\frac {(3 A-2 B+2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(A-B+C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(3 A-2 B+2 C) \int 1 \, dx}{2 a} \\ & = \frac {(3 A-2 B+2 C) x}{2 a}-\frac {(2 A-2 B+C) \sin (c+d x)}{a d}+\frac {(3 A-2 B+2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(A-B+C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))} \\ \end{align*}
Time = 0.82 (sec) , antiderivative size = 213, normalized size of antiderivative = 1.97 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (4 (3 A-2 B+2 C) d x \cos \left (\frac {d x}{2}\right )+4 (3 A-2 B+2 C) d x \cos \left (c+\frac {d x}{2}\right )-20 A \sin \left (\frac {d x}{2}\right )+20 B \sin \left (\frac {d x}{2}\right )-16 C \sin \left (\frac {d x}{2}\right )-4 A \sin \left (c+\frac {d x}{2}\right )+4 B \sin \left (c+\frac {d x}{2}\right )-3 A \sin \left (c+\frac {3 d x}{2}\right )+4 B \sin \left (c+\frac {3 d x}{2}\right )-3 A \sin \left (2 c+\frac {3 d x}{2}\right )+4 B \sin \left (2 c+\frac {3 d x}{2}\right )+A \sin \left (2 c+\frac {5 d x}{2}\right )+A \sin \left (3 c+\frac {5 d x}{2}\right )\right )}{8 a d (1+\cos (c+d x))} \]
[In]
[Out]
Time = 0.23 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.62
method | result | size |
parallelrisch | \(\frac {\left (A \cos \left (2 d x +2 c \right )+\left (-2 A +4 B \right ) \cos \left (d x +c \right )-7 A +8 B -4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+6 x d \left (A -\frac {2 B}{3}+\frac {2 C}{3}\right )}{4 d a}\) | \(67\) |
derivativedivides | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {2 \left (-\frac {3 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+2 \left (-\frac {A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+\left (3 A -2 B +2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(115\) |
default | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {2 \left (-\frac {3 A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+2 \left (-\frac {A}{2}+B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+\left (3 A -2 B +2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(115\) |
risch | \(\frac {3 A x}{2 a}-\frac {B x}{a}+\frac {x C}{a}+\frac {i A \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}-\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}-\frac {i A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a d}-\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {A \sin \left (2 d x +2 c \right )}{4 a d}\) | \(185\) |
norman | \(\frac {\frac {\left (2 A -3 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {\left (3 A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {\left (3 A -2 B +2 C \right ) x}{2 a}-\frac {\left (A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{a d}-\frac {\left (3 A -2 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2 a}+\frac {\left (3 A -2 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a}+\frac {\left (3 A -2 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2 a}-\frac {\left (4 A -3 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) | \(232\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.83 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {{\left (3 \, A - 2 \, B + 2 \, C\right )} d x \cos \left (d x + c\right ) + {\left (3 \, A - 2 \, B + 2 \, C\right )} d x + {\left (A \cos \left (d x + c\right )^{2} - {\left (A - 2 \, B\right )} \cos \left (d x + c\right ) - 4 \, A + 4 \, B - 2 \, C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\int \frac {A \cos ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 273 vs. \(2 (104) = 208\).
Time = 0.32 (sec) , antiderivative size = 273, normalized size of antiderivative = 2.53 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {A {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + B {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - C {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.27 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\frac {{\left (d x + c\right )} {\left (3 \, A - 2 \, B + 2 \, C\right )}}{a} - \frac {2 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (3 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \]
[In]
[Out]
Time = 16.80 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.03 \[ \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {x\,\left (3\,A-2\,B+2\,C\right )}{2\,a}-\frac {\left (3\,A-2\,B\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (A-2\,B\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A-B+C\right )}{a\,d} \]
[In]
[Out]